Move GdkWindowRegionMove construction/destruction to separate functions
authorAlexander Larsson <alexl@redhat.com>
Sun, 8 Feb 2009 12:17:37 +0000 (13:17 +0100)
committerAlexander Larsson <alex@localhost.localdomain>
Thu, 2 Apr 2009 08:16:28 +0000 (10:16 +0200)
gdk/gdkwindow.c

index 66c5b5d45899fc6f786e3dec334ea1659998bb6c..bef015f1d66d5f1a9006f03f54ab56f590a44c0d 100644 (file)
@@ -2537,10 +2537,9 @@ do_move_region_bits_on_impl (GdkWindowObject *impl_window,
   gdk_gc_set_clip_region (tmp_gc, NULL);
 }
 
-static void
-append_move_region (GdkWindowObject *impl_window,
-                   GdkRegion *region,
-                   int dx, int dy)
+static GdkWindowRegionMove *
+gdk_window_region_move_new (GdkRegion *region,
+                           int dx, int dy)
 {
   GdkWindowRegionMove *move;
       
@@ -2549,6 +2548,25 @@ append_move_region (GdkWindowObject *impl_window,
   move->dx = dx;
   move->dy = dy;
 
+  return move;
+}
+
+static void
+gdk_window_region_move_free (GdkWindowRegionMove *move)
+{
+  gdk_region_destroy (move->dest_region);
+  g_slice_free (GdkWindowRegionMove, move);
+}
+
+static void
+append_move_region (GdkWindowObject *impl_window,
+                   GdkRegion *region,
+                   int dx, int dy)
+{
+  GdkWindowRegionMove *move;
+      
+  move = gdk_window_region_move_new (region, dx, dy);
+
   impl_window->outstanding_moves =
     g_list_append (impl_window->outstanding_moves, move);
 }
@@ -2613,8 +2631,7 @@ gdk_window_flush_outstanding_moves (GdkWindow *window)
       do_move_region_bits_on_impl (impl_window,
                                   move->dest_region, move->dx, move->dy);
 
-      gdk_region_destroy (move->dest_region);
-      g_slice_free (GdkWindowRegionMove, move);
+      gdk_window_region_move_free (move);
     }
   
   g_list_free (impl_window->outstanding_moves);